/*
 * @Descripttion: 购物车相关中间件
 * @version: 
 * @Author: 一氧化二氢
 * @Date: 2022-01-03 21:19:08
 * @lastEditorTime: Do no edit
 */

const {invalidGoodsID } = require('../constant/err.type')
const validator = async (ctx, next) => {
    try {
        ctx.verifyParams({
            goods_id:"number",
        })
     
    } catch (err) {
            console.error("参数校验错误",err)
            invalidGoodsID.result =err
           return ctx.app.emit("error",invalidGoodsID,ctx)
    }
    await next()
}

module.exports = {
    validator
}